package com.vdimitr.katapotter;

/**
 * Finds the discount based on the number of books
 * 
 * @author vasileios.dimitriadis
 *
 */
public class DiscountPriceCalculator {

	public double getDiscount(int numberOfBooks) {
		Discount discount = Discount.NO_DISCOUNT;
		for(Discount d : Discount.values()) {
			if(d.getNumberOfBooks() == numberOfBooks) {
				discount = d;
			}
		}
		return discount.getDiscount();
	}
}
